package com.zd.shopping.apis;

import android.content.Context;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zd.shopping.bean.WmOmNoticeHEntity;
import com.zwz.mall.api.BaseApi;
import com.zwz.mall.api.OnRequestListener;
import com.zwz.mall.models.User;
import com.zwz.mall.utils.JSONUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * Created by Administrator on 2019/7/9 0009.
 */

public class NuclearGoodsApi extends BaseApi
{
 public List list =new ArrayList ();
 public String username;
 public String searchstr;
 public String searchstr2=null;
    private WmOmNoticeHEntity wmOmNoticeHEntity;

    @Override
    public void loadData(OnRequestListener requestListener) {
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put("username", username);
            hashMap.put("searchstr", searchstr);
            if (searchstr2!=null){
            hashMap.put("searchstr2", searchstr2);}
        super.loadData(getBaseApiService().he_huo(hashMap), requestListener);
    }

    @Override
    public void parseResult(JSONObject jsonObject) {
        JSONArray obj = JSONUtils.getJSONArray ("obj", jsonObject);
        for (int i = 0,len=obj.size(); i <len ; i++) {
            JSONObject jsonObject1 = JSONUtils.getJSONObject(i, obj);
            wmOmNoticeHEntity = new WmOmNoticeHEntity ();
            wmOmNoticeHEntity.parse(jsonObject1);
            list.add(wmOmNoticeHEntity);
        }


    }
}
